home *** CD-ROM | disk | FTP | other *** search
/ User's Choice Windows CD / User's Choice Windows CD (CMS Software)(1993).iso / windows4 / pcproj.zip / PWSETDIA.CLS < prev    next >
Text File  |  1988-09-01  |  2KB  |  74 lines

  1. /* Project Window Settings dialog.  Allows the user to
  2.    specify what information will be displayed above and
  3.    below each node on the screen. 
  4.    Note: The parent of this dialog must be a ProjWindow.
  5. */!!
  6.  
  7. inherit(Dialog, #PWSetDialog, #(top      /* selected button offset */
  8. bot      /* selected button offset */), 2, nil)!!
  9.  
  10. now(PWSetDialogClass)!!
  11.  
  12. now(PWSetDialog)!!
  13.  
  14. /* A radio button was pressed.  Determine which
  15.    group it belonged to and update the others. 
  16.    Store the newly updated top or bottom offset number.*/
  17. Def  buttonPress(self, aButton)
  18. {
  19.   if between(aButton, TTIME, TLF)
  20.     Call CheckRadioButton(hWnd, TTIME, TLF, aButton);
  21.     top := aButton - TTIME;
  22.   else
  23.     Call CheckRadioButton(hWnd, BTIME, BLF, aButton);
  24.     bot := aButton - BTIME;
  25.   endif;
  26.   
  27. }!!
  28.  
  29. /* Update the methods of the project window. */
  30. Def  update(self)
  31. {
  32.   setTopMethod(parent, top);
  33.   setBotMethod(parent, bot);
  34. }!!
  35.  
  36. /* Initialize the dialog so buttons are correct. */
  37. Def initDialog(self, wp, lp)
  38. {
  39.   if top := getTopMethod(parent)
  40.     Call CheckRadioButton(hWnd, TTIME, TLF, top + TTIME);
  41.   endif;
  42.   if bot := getBotMethod(parent)
  43.     Call CheckRadioButton(hWnd, BTIME, BLF, bot + BTIME);
  44.   endif;
  45. }
  46. !!
  47.  
  48. /* Handle the pressing of buttons.  If Ok was 
  49.    pressed, then update the methods used to
  50.    display information. */
  51. Def command(self, wp, lp)
  52. {
  53.   select
  54.     case wp == IDOK
  55.        update(self);
  56.        end(self, IDOK);
  57.     endCase
  58.     case wp == IDCANCEL            
  59.        end(self, IDCANCEL);
  60.     endCase
  61.     case wp == PW_CLEAR
  62.        top := nil;
  63.        bot := nil;
  64.        update(self);
  65.        end(self, IDOK);
  66.     endCase
  67.     default  /* a radio button was pressed */
  68.        buttonPress(self, wp);
  69.       ^1;  
  70.   endSelect;
  71.   ^0;  
  72. } !!
  73.  
  74.